package com.mhc.haval.controller;

import com.mhc.haval.constant.WebConstants;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhenmo on 17/8/21 13:43.
 */
@RestController
public class CommController {

    /**
     * 错误页面
     *
     * @param model
     * @param errMsg
     * @return
     */
    @RequestMapping(value="/error", method = RequestMethod.GET)
    public String error(ModelMap model, @RequestParam(required = false) String errMsg) {
        model.put(WebConstants.Param.ERR_MSG, errMsg);
        return WebConstants.Template.ERROR;
    }
}
